using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : BehaviourSingleton<CameraController>
{
    public Transform target;
    public float speed;
    private void FixedUpdate()
    {
        if (target!=null)
        transform.position = Vector3.MoveTowards(transform.position,new Vector3(target.position.x,target.position.y,transform.position.z),speed*Time.deltaTime);
    }
    public void ChangeTarget(Transform newTarget)
    {
        target = newTarget;
    }
}
